﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Input;

namespace JPGResizer.Controls
{
    class NumbericTextBox:TextBox
    {
        protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
        {
            if (this.IsFocused)
            {
                if (((e.Key >= Key.D0) && (e.Key <= Key.D9))
                    || ((e.Key >= Key.NumPad0) && (e.Key <= Key.NumPad9)))
                {
                   //
                }
                else
                {
                    e.Handled = true;
                }
            }
            else
            {
                e.Handled = true;
            }
            base.OnKeyDown(e);
        }
    }
}
